import { ref } from 'vue'
import { getReportListAPI } from '@/apis/report'


export default function useReportInfo(currPage, pageSize) {

  const reportList = ref([])
  const total = ref(0)

  getPageData(currPage, pageSize)

  async function getPageData(pageNo, pageSize) {
    const res = await getReportListAPI({ pageNo, pageSize })
    reportList.value = res.data.records
    total.value = res.data.total
  }

  return {
    reportList,
    total,
    getPageData
  }
}